/**
 * 主要路由
 */
import { lazy } from 'react';
const IndexPage = lazy(() => import('../views/IndexPage'));
const AboutUs = lazy(() => import('../views/AboutUs'));
const DeviceComparation = lazy(() => import('../views/DeviceComparation'));
const DeviceList = lazy(() => import('../views/DeviceList'));
const DeviceKnowledgeList = lazy(() => import('../views/DeviceKnowledgeList'));
const Manufacturer = lazy(() => import('../views/Manufacturer/Manufacturer'));
const ReviewArticleList = lazy(() => import('../views/ReviewArticleList'));
const DeviceAdminControl = lazy(() => import('../views/DeviceAdminControl'));
const SiteManage = lazy(() => import('../views/SiteManage'));
const DeviceDisplay = lazy(() => import('../views/Device/DeviceDisplay'));
const ManufacturerDisplay = lazy(() => import('../views/Manufacturer/ManufacturerDisplay'));
const ArticleDisplay = lazy(() => import('../components/ArticleDisplay'));

// import {
// IndexPage,
// AboutUs,
// DeviceComparation,
// DeviceList,
// DeviceKnowledgeList,
// ReviewArticleList,
// Manufacturer,
// Personal,
// SiteManage,
// DeviceDisplay,
// ManufacturerDisplay
// } from '../views'
// import { ArticleDisplay } from '../components'


export type mainRoutesType = {
    component: any,
    path: string,
    exact?: boolean,
    isNav: boolean           //是否在导航栏上显示
}

export const mainRoutes: mainRoutesType[] = [
    //首页
    {
        component: IndexPage,
        path: '/',
        exact: true,
        isNav: true
    },
    //设备列表
    {
        component: DeviceList,
        path: '/devicelist',
        isNav: true

    },
    //设备知识文章列表
    {
        component: DeviceKnowledgeList,
        path: '/deviceknowledge',
        isNav: true
    },
    //设备对比页面
    {
        component: DeviceComparation,
        path: '/devicecomparation',
        isNav: true
    },
    //评测文章
    {
        component: ReviewArticleList,
        path: '/reviewarticle',
        isNav: true
    },
    //厂商名录
    {
        component: Manufacturer,
        path: '/manufacturer',
        exact: true,
        isNav: true,
    },
    //具体展示厂商页面
    {
        component: ManufacturerDisplay,
        path: '/manufacturer/:manuID',
        isNav: false
    },
    //关于我们
    {
        component: AboutUs,
        path: '/aboutus',
        exact: false,
        isNav: true
    },
    //文章显示页面
    {
        component: ArticleDisplay,
        path: '/article/:id',
        isNav: false
    },
    //设备显示页面
    {
        component: DeviceDisplay,
        path: '/device/:id',
        isNav: false
    },
    //个人管理页面
    {
        component: DeviceAdminControl,
        path: '/personal/:view',
        exact: false,       //路由后有子路由决定渲染页面
        isNav: false
    },
    //超管管理页面
    {
        component: SiteManage,
        path: '/siteManage/:view',
        isNav: false
    }
]
